from django.contrib import admin

from .models import *


class UserAdmin(admin.ModelAdmin):
    list_display = ("nickname", "phone")
    search_fields = ('nickname', "phone")


class ApiAccessTokenAdmin(admin.ModelAdmin):
    list_display = ("user", "access_token", "expire_timestamp")


class VerifyCodeAdmin(admin.ModelAdmin):
    list_display = ('phone_id', 'code', 't')
    list_filter = ('t', )
    search_fields = ('phone_id', 'code')


class PhotoAdmin(admin.ModelAdmin):
    list_display = ("id", "user", "url", "type", "create_timestamp")


admin.site.register(User, UserAdmin)
admin.site.register(ApiAccessToken, ApiAccessTokenAdmin)
admin.site.register(VerifyCode, VerifyCodeAdmin)
admin.site.register(Photos, PhotoAdmin)
